package com.ouc.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @Name: SwaggerConfig
 * @Description:
 * @Author: Mr.Tong
 */
@Configuration
@EnableSwagger2
public class SwaggerConfig {
    @Bean

    public Docket webApiConfig() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("FrameApi")
                .apiInfo(webApiInfo())
                .select()
                .build();
    }

    //个人信息
    private ApiInfo webApiInfo() {
        return new ApiInfoBuilder()
                .title("Frame Swagger")
                .description("本文描述了Frame项目的各种接口，供前端调用")
                .version("1.0")
                .contact(new Contact("阿胜大叔2020", "http://oucystong.com", "buaatys@163.com"))
                .build();
    }
}
